﻿@using SH = EMoney.IStock.Client.Framework.StringHelper;
@{
    int todayCount = 0;
    int todayINum = 0;
    int unCount = 0;
    int unINum = 0;
    
    if(ViewBag.TodayCount != null)
    {
        todayCount = ViewBag.TodayCount;
    }
    if(ViewBag.TodayINum != null)
    {
        todayINum = ViewBag.TodayINum;
    }
    
    if(ViewBag.UnCount != null)
    {
        unCount = ViewBag.UnCount;
    }
    if(ViewBag.UnINum != null)
    {
        unINum = ViewBag.UnINum;
    }

    decimal percent = 0;
    
    if(todayCount > 0)
    {
        percent = (decimal)todayCount / (unCount + todayCount) * 100;
    }

    string height = string.Concat(128 - (percent * 128 / 100),"px");
    }
<div class="jd_k">
    <div class="progressBx" style="background:url(@SH.GetStaticFile("IStockClientStatic/mc/images/jdimg_1.png)") 0 0 no-repeat;">
        <div class="prg_bg">
            <div class="percent">@SH.FormatDecimal(percent,"0")%</div><div class="prg_i" style="height:@height;background:url(@SH.GetStaticFile("IStockClientStatic/mc/images/jdimg_0.png)") 0 0 no-repeat;">
            <div class="percent">@SH.FormatDecimal(percent,"0")%</div><div class="wav"></div></div>
        </div>
    </div>
</div>
<div class="jd_inf">
    @{
        if(unCount == 0)    //没有未完成的任务
        {
            <p>今日已完成所有任务</p>
            <p>获得<span class="blue"> @todayINum </span>i豆</p>
        }
        else
        {
            <p>今日已完成<span class="blue"> @todayCount </span>个任务</p>
            <p>获得<span class="blue"> @todayINum </span>i豆</p>
            <p>您还可以做<span class="red"> @unCount </span>个任务</p>
            <p>最多可赢得<span class="red"> @unINum </span>i豆</p>
        }
        }    
</div>
<input type="hidden" id="hidUnCount" value="@unCount" />
<script type="text/javascript">
    var unCount = $("#hidUnCount").val();

    if(parseInt(unCount) > 0)
    {
        $("#TaskCount").html(unCount);
        $("#TaskCount").show();

        $(".ind_r").css("cursor", "pointer");
        $(".ind_r").click(function () {
            $(".menu_k span")[1].click();
        });
    }
    else
    {
        $("#TaskCount").hide();
    }
</script>